<?php
/*
 * Requer os seguintes defines:
 * SITE_NAME
 * SITE_REF
 * PASSWORD_RESET_EMAIL_UTILIZADOR
 * PASSWORD_RESET_NEW_DECODED_PASS
 * ADMIN_EMAIL
 */

// subject
$subject = 'Pedido Registo '. SITE_NAME;

// message
$message = '
<html>
<head>
  <title>Password Reset ' . SITE_REF . '</title>
</head>
<body>
  <p>Password Reset for ' . PASSWORD_RESET_EMAIL_UTILIZADOR .' </p>
  password reset a pedido do utilizador para esta conta.<BR />
  email: ' . PASSWORD_RESET_EMAIL_UTILIZADOR . '<BR />
  New password: ' . PASSWORD_RESET_NEW_DECODED_PASS . '<BR />
</body>
</html>
';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";

// Additional headers
$headers .= 'From: ' . SITE_NAME . ' <' . ADMIN_EMAIL . '>' . "\r\n"; //optional headerfields
$headers .= 'To: Utilizador <' . PASSWORD_RESET_EMAIL_UTILIZADOR . '>' . "\r\n";
$headers .= 'Bcc: ' . ADMIN_EMAIL . "\r\n";
$headers .= 'Reply-To: '. ADMIN_EMAIL . "\r\n";

// Mail it
mail(PASSWORD_RESET_EMAIL_UTILIZADOR, $subject, $message, $headers);

//Ausencia da funcao mail, utilizar esta var 
define('EMAIL_ENVIADO', $message);
?>
